<?php

class Stories extends HTech_Db_Table
{
    protected $_name    = 'view_stories';
    protected $_primary = 'StoryId';  

    protected function _setGridMetadata()
    {
        switch($this->_name) {
            case '_log_stories':
                $this->_gridMetadata['title']   = $this->translate("Stories' Log");
                $this->_gridMetadata['titleMods'] = array('LocationShortName','OfficerUsername');
                $this->_gridMetadata['params']  = array('StoryId');
                $this->_gridMetadata['onClick'] = 'admin.story.view';
                $this->_gridMetadata['headers'] = array
                    (
                        array('StoryId',             50, $this->translate("Story id"),            'Number'),
                        array('BirthPlace',          50, $this->translate("Birth place"),         'String'),
                        array('GrowthPlace',         50, $this->translate("Growth place"),        'String'),
                        array('FamilyInfo',          50, $this->translate("Family info"),         'String'),
                        array('HeardAboutUs',        50, $this->translate("HeardAboutUs"),        'String'),
                        array('CreditBeforeUs',      50, $this->translate("CreditBeforeUs"),      'String'),
                        array('BusinessRoutine',     50, $this->translate("BusinessRoutine"),     'String'),
                        array('BusinessProgress',    50, $this->translate("BusinessProgress"),    'String'),
                        array('BusinessChallenges',  50, $this->translate("BusinessChallenges"),  'String'),
                        array('PersonalInterests',   50, $this->translate("PersonalInterests"),   'String'),
                        array('HealthImpact',        50, $this->translate("HealthImpact"),        'String'),
                        array('HousingImpact',       50, $this->translate("HousingImpact"),       'String'),
                        array('FamilyImpact',        50, $this->translate("FamilyImpact"),        'String'),
                        array('CommunityImpact',     50, $this->translate("CommunityImpact"),     'String'),
                        array('BusinessImpact',      50, $this->translate("BusinessImpact"),      'String'),
                        array('SpiritualImpact',     50, $this->translate("SpiritualImpact"),     'String'),
                        array('PlusServices',        50, $this->translate("PlusServices"),        'String'),
                        array('PlusServicesDetails', 50, $this->translate("PlusServicesDetails"), 'String'),
                        array('Dreams',              50, $this->translate("Dreams"),              'String'),
                        array('Quote',               50, $this->translate("Quote"),               'String'),
                        array('Comments',            50, $this->translate("Comments"),            'String')
                    );
                break;
            default:
                $this->_gridMetadata['title']   = $this->translate("Stories");
                $this->_gridMetadata['titleMods'] = array('LocationShortName','OfficerUsername');
                $this->_gridMetadata['params']  = array('OfficerUserId','CommunityId','LocationId');
                $this->_gridMetadata['onClick'] = 'admin.story.view';
                $this->_gridMetadata['headers'] = array
                    (
                        array('ClientId',          50, $this->translate("Id"),              'Number'),
                        array('OfficerUsername',   85, $this->translate("Officer"),         'String'),
                        array('LocationShortName', 70, $this->translate("Branch"),          'String'),
                        array('Community',        150, $this->translate("Community"),       'String'),
                        array('CommunityType',     80, $this->translate("Com. type"),       'String'),
                        array('GroupName',        250, $this->translate("Group"),           'String'),
                        array('Code',             100, $this->translate("Identity number"), 'String'),
                        array('CodeType',         100, $this->translate("Id. type"),        'String'),
                        array('Gender',            60, $this->translate("Gender"),          'String'),
                        array('Birthdate',         80, $this->translate("Birthdate"),       'DateTime', 'Date'),
                        array('FullName',         180, $this->translate("Name"),            'String'),
                        array('NickName',          80, $this->translate("Nickname"),        'String'),
                        array('Children',          80, $this->translate("Children"),        'String'),
                        array('Dependents',        80, $this->translate("Dpndnts"),         'String'),
                        array('HomePhone',        100, $this->translate("Home phone"),      'String'),
                        array('MobilePhone',      100, $this->translate("Mobile phone"),    'String')
                    );
                
        }
        return $this;
    }
}